package com.jstyle.beatecg.NetWork.api;



import com.jstyle.beatecg.model.NetResultData;
import com.jstyle.beatecg.model.UpdateData;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;


/**
 * Created by Administrator on 2017/3/24.
 */

public interface JstyleApi {
    @GET("sms/send")
    Observable<NetResultData> getSmsCode(@QueryMap Map<String, Object> userMap);

    @GET("sms/sendEmail")
    Observable<NetResultData> getEmailCode(@QueryMap Map<String, Object> userMap);
    @FormUrlEncoded
    @POST("user/register")
    Observable<NetResultData>register(@FieldMap Map<String, Object> userMap);

    @FormUrlEncoded
    @POST("user/login")
    Observable<NetResultData>login(@FieldMap Map<String, Object> userMap);

    @FormUrlEncoded
    @POST("user/retrieve")
    Observable<NetResultData>findPassword(@FieldMap Map<String, Object> userMap);

    @FormUrlEncoded
    @POST("user/loginAuth")
    Observable<NetResultData>loginAuth(@FieldMap Map<String, Object> userMap);

    @GET("user/validateToken")
    Observable<NetResultData> getUserId(@Query("query") boolean query, @Query("token") String token);

    @FormUrlEncoded
    @POST("user/updatePwd")
    Observable<NetResultData> changePsd(@FieldMap Map<String, Object> maps);

    @FormUrlEncoded
    @POST("user/updatePhone")
    Observable<NetResultData> changePhone(@FieldMap Map<String, Object> maps);

    @FormUrlEncoded
    @POST("opinion/save")
    Observable<NetResultData> feedBack(@FieldMap Map<String, String> maps);

    @GET("https://api.le-young.com/device/firmware/update")
    Observable<UpdateData>queryDeviceVersion(@QueryMap Map<String, String> versionMap);

   // @GET("https://api.le-young.com/sleep/user/save")
   // Observable<UpdateData>insertUserInfo(@QueryMap Map<String, String> infoMap);

    @Streaming
    @GET
    Observable<ResponseBody> downloadPath(@Url String url);

    @Streaming
    @GET
    Observable<ResponseBody> downloadIcon(@Url String url);

    @Multipart
    @POST("share/upImg")
    Observable<NetResultData> updateImage(@Part MultipartBody.Part file, @PartMap Map<String, RequestBody> maps);
}
